package com.pureland.ucc.controller;

import com.pureland.common.entity.R;
import com.pureland.security.annotations.IgnoreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: pureland_cloud
 * @className: com.pureland.ucc.controller.DemoController
 * @description:
 * @author: tong.li
 * @createTime: 2020/11/26 13:56
 * @version: v1.0
 * @copyright: 版权所有 李彤 © 2020
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    /**
     * 通过配置的方式(security.oauth2.client.ignoreUrls)可以认证/权限放行
     * @return
     */
    @GetMapping("/ignore1")
    public R ignore1() {
        return R.ok("111");
    }

    /**
     * 通过@IgnoreAuthorize注解忽略认证授权
     * @return
     */
    @GetMapping("/ignore2")
    @IgnoreAuthorize
    public R ignore2() {
        return R.ok("222");
    }






}
